import Vue from "vue";
import Router from "vue-router";
Vue.use(Router);
import index from "../views/index.vue"; //首页
import goodsdetail from "../views/goods/goodsDetail.vue"; //商品详情
import goodslist from "../views/goods/goodsList.vue"; //商品列表
import noticelist from "../views/notice/noticelist"; //公告列表
import noticedetail from "../views/notice/noticedetail"; //公告详情
import brandcenter from "../views/brand/brandcenter"; //品牌中心
import branddetail from "../views/brand/branddetail"; //商品详情
import b_goodsdetail from "../views/brand/b_goodsdetail"; //从品牌详情进入的商品详情页
import integralmall from "../views/Integral/Integralmall"; //积分商城
import exchangemall from "../views/Integral/exchangemall"; //积分商城兑换及兑换成功
import shopcart from "../views/shopcart/shopcart"; //购物车页面
import invoice from "@/components/invoice.vue"; //新增发票信息的模态框
import order from "../views/shopcart/carorder"; // 订单页面 从购物车跳转至订单页面
import add_invoice from "../components/add_invoice" //购物车确认购物信息一栏的新增发票
import personalCenter from "../views/person_center/personalCenter"; //个人中心
import manage from "../views/person_center/manage"; //个人中心--账户管理
import invoice_1 from "../components/invoice_1" //个人中心 账户管理 编辑发票
import allcash from "../views/person_center/allcash" //个人中心 账号管理 全部提现
import member from "../views/person_center/memberCenter"; // 个人中心--会员认证
import myorder from "../views/person_center/order/myorder" //个人中心 我的订单
import myyhq from "../views/person_center/myyhq" //个人中心 我的优惠券
import yhq_detail from "../views/person_center/yhq_detail" // 个人中心 我的优惠券 优惠券详情
import myjf from "../views/person_center/myjf" //个人中心 我的积分
import mysc from "../views/person_center/mysc" //个人中心 我的收藏
import hyqy from "../views/person_center/hyqy" //个人中心 会员权益
import mytz from "../views/person_center/mytz" //个人中心 我的通知
import helpcenter from "../views/person_center/helpcenter" //个人中心 帮助中心
import helpdetail from "../views/person_center/helpdetail" //个人中心 帮助中心 帮助详情
import contact from "../views/person_center/contact" // 个人中心 联系客服
import orderDetail from "../views/person_center/order/orderDetail" //个人中心 我的订单 订单详情
export default new Router({
  mode: "history",
  base: process.env.BASE_URL,
  routes: [
    // 首页
    {
      path: "/",
      name: "index",
      component: index,
      children: []
    },
    //  品牌中心
    {
      path: "/brandcenter",
      name: "brandcenter",
      component: brandcenter
    },
    // 品牌详情
    {
      path: "/branddetail",
      name: "branddetail",
      component: branddetail
    },
    //积分商城
    {
      path: "/integralmall",
      name: "integralmall",
      component: integralmall
    },
    //积分商城兑换
    {
      path: "/exchangemall",
      name: "exchangemall",
      component: exchangemall
    },
    //从品牌详情页跳转的商品详情页
    {
      path: "/b_goodsdetail",
      name: "b_goodsdetail",
      component: b_goodsdetail
    },
    //商品列表
    {
      path: "/goodslist",
      name: "goodslist",
      component: goodslist
    },
    //商品详情页
    {
      path: "/goodsdetail",
      name: "goodsdetail",
      component: goodsdetail
    },
    //公告列表
    {
      path: "/noticelist",
      name: "noticelist",
      component: noticelist
    },
    //公告详情
    {
      path: "/noticedetail",
      name: "noticedetail",
      component: noticedetail
    },
    // 购物车
    {
      path: "/shopcart",
      name: "shopcart",
      component: shopcart
    },
    //购物车跳转的订单页面
    {
      path: "/order",
      name: "order",
      component: order,
      children: [{
        path: 'add_invoice',
        naem: "add_invoice",
        component: add_invoice
      }, ]
    },
    //个人中心
    {
      path: "/personalCenter",
      name: "personalCenter",
      component: personalCenter,
      children: [
        // 账号管理
        {
          path: "manage",
          name: "manage",
          component: manage,
          children: [{
              path: "invoice",
              name: "invoice",
              component: invoice
            },
            {
              path: "invoice_1",
              name: "invoice_1",
              component: invoice_1
            }
          ]
        },
        // 账号管理下的全部提现
        {
          path: "allcash",
          name: "allcash",
          component: allcash
        },
        // 会员认证
        {
          path: "member",
          name: "member",
          component: member
        },
        // 我的订单
        {
          path: "myorder",
          name: "myorder",
          component: myorder
        },
        // 订单详情
       {
         path:"order_detail",
         name:"order_detail",
         component:orderDetail
       },
        //我的优惠券
        {
          path: "myyhq",
          name: "myyhq",
          component: myyhq
        },
        // 我的优惠券详情页
        {
          path: "yhq_detail",
          name: "yhq_detail",
          component: yhq_detail
        },
        // 我的积分
        {
          path: "myjf",
          name: "myjf",
          component: myjf
        },
        //我的收藏
        {
          path: "mysc",
          name: "mysc",
          component: mysc
        },
        //会员权益
        {
          path: "hyqy",
          name: "hyqy",
          component: hyqy
        },
        //我的通知
        {
          path: "mytz",
          name: "mytz",
          component: mytz
        },
        //帮助中心
        {
          path: "helpcenter",
          name: "helpcenter",
          component: helpcenter
        },
        //帮助详情
        {
          path: "helpdetail",
          name: "helpdetail",
          component: helpdetail
        },
        //联系客服
        {
          path: "contact",
          name: "contact",
          component: contact
        }
      ]
    }
  ]
});